package com.ruikong.dazhi.utils;

import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject: jiuyanng
 * @BelongsPackage: com.ruikong.dazhi.utils
 * @Author: Hassion.Tang
 * @Description: TODO
 * @Version: 1.0
 */
@Configuration
public class PLCUtil {

    @Value("${plc.ipAddress}")
    private String  address;


//    @Value("${plc.port}")
//    private  int port;



    /**
     * @description:获取plc对象
     * @author: Hassion.Tang
     * @param: [address]
     * @return: [java.lang.String]
     **/
    @Bean
    public  S7PLC s7PLC() {
        S7PLC s7PLC=new S7PLC(EPlcType.S1200,address);
        return s7PLC;
    }


}
